<%@ page language="java" pageEncoding="utf-8"%>
<%@ page import="java.util.*" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>奋青网-帖子详情</title>
<link href="css/Main.css" rel="stylesheet" type="text/css" />
<link href="css/Post.css" rel="stylesheet" type="text/css" />
<link href="css/common.css" rel="stylesheet" type="text/css" />
<link href="css/boxy.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/Jquery-1-5-2.js"></script>
<script type="text/javascript" src="js/Main.js"></script>
<script type="text/javascript" src="js/Post.js"></script>
<script type="text/javascript" src="js/jquery.boxy.js"></script>
<script src="js/redactor/redactor.js"></script>
<link href="js/redactor/css/redactor.css" rel="stylesheet"  type="text/css" />
<script language="javascript">
<!--
	window.wid ;
	window.mid ;
	window.srid ;
	window.rid ;
	window.chart ;
	function rep(str){    //举报表
		window.chart = str ;
	}
	function report(rid){  //举报编号
		window.rid = rid ;
	}
	function spid(wid){
		window.wid = wid ;
		srid = null ;
	}
	function cmdid(cmid){
		window.mid = cmid ;
	}
	//投票处

	function ps1(wid){
		$.ajax({
			type:"POST",
			url:"Post?action=lb&type=a&wid="+wid,
			dataType:"text",
			async:false ,
			success:casuccess 
		});
		function casuccess(a){
			var ps1 = document.getElementById('ps'+wid);
			ps1.innerHTML = a;
		}
	};
	function ps2(wid){
		$.ajax({
			type:"POST" ,
			url:"Post?action=lb&type=dis&wid="+wid ,
			dataType:"text",
			async:false ,
			success:success
		});
		function success(a){
			var ps2 = document.getElementById('dis'+wid);
			ps2.innerHTML = a ;
		}
	}
	function seek(name){    //搜索在线人员
		name = encodeURI(name);
		$.ajax({
			type:"POST" ,
			url:"Post?action=seek&name="+name ,
			dateType:"text" ,
			async:false ,
			success:seek 
		});
		function seek(list){
			var ul = document.getElementById('User_Result');
			ul.innerHTML = list ;
		}
	}
	
-->
</script>
<script type="text/javascript">
<!--
	function getType(){
		var type = document.form1.type ;
		var action = document.form1.action ;
		action = action.value ;
		var form = document.form1 ;
		if(type.value==2){
			form.action="${applicationScope.path }/Active";
		}else if(type.value==1){
			form.action="${applicationScope.path }/ArticleList";
		}else if(type.value==0){
			form.action="${applicationScope.path }/ClubList";
		}
	}
-->
</script>
<link href="js/redactor/css/redactor.css" rel="stylesheet"  type="text/css" />
</head>
<body>
<div id="Top">
  <div class="Top_all"> <a href="#"><img src="images/LOGO.jpg"/></a>
    <ul id="Top_Nav">
      <li><a href="${applicationScope.path }/Index">首页</a></li>
      <li><a href="${applicationScope.path }/ArticleList">领域</a></li>
      <li><a href="#">发现</a></li>
    </ul>
    <ul id="Second_Menu">
      	<li><a href="${applicationScope.path }/ClubList">发现社团</a><li>
      	<li><a href="#">对味奋青</a><li>
      	<li><a href="${applicationScope.path }/Active">有趣活动</a><li>
      </ul>
    <div id="Search">
      <div class="Search_l"></div>
      <form name="form1" method="post" action="" onsubmit="getType();">
      	<input type="hidden" name="action" value="search" />
        <input type="text" id="Search_Box" name="content" value="搜索社团、文章、活动..."/>
        <img src="images/search_btn.jpg" id="Search_Btn"/>
        <input type="hidden" value="0" id="Search_What" name="type"/>  <!--传送搜索类型参数-->
      </form>
    </div>
    <div id="Search_Option">
    	<p class="Search_Option_Hover"><img src="images/search_hover0.jpg"/>包含<span></span>的社团</p>
    	<p><img src="images/search_hover1.jpg"/>包含<span></span>的帖子</p>
    	<p><img src="images/search_hover2.jpg"/>包含<span></span>的活动</p>
    </div>
    <div id="User_Top">
    <c:choose>
    	<c:when test="${not empty sessionScope.user}">
    	<c:forEach items="${requestScope.login}" var="login">
    		<img src="${login.uphoto}"/><a href="${applicationScope.path }/Pro?uid=${login.uid}">${login.uname}</a>
        	<ul id="User_Info_Box">
	        	<li><a href="${applicationScope.path }/Pro?uid=${login.uid}"><img src="images/home.jpg"/>个人主页</a></li>
	        	<li><a href="${applicationScope.path }/Pro?uid=${login.uid}&lx=private"><img src="images/sms.jpg"/>私信</a></li>
	        	<li><a href="${applicationScope.path }/Pro?uid=${login.uid}&lx=edit"><img src="images/control.jpg"/>设置</a></li>
	        	<li><a href="${applicationScope.path }/Logout.jsp"><img src="images/logout.jpg"/>注销</a></li>
        	</ul>
        </c:forEach>
    	</c:when>
   	 	<c:otherwise>
    		<a href="${applicationScope.path }/Entrance.jsp">您还未登录</a>
    	</c:otherwise>
    </c:choose>
    </div>
    <img src="images/help.jpg" id="Help_Btn" title="帮助中心"/> </div>
</div>
<!--头部结束-->
<div class="Page_Top"></div>
<div class="Page_Middle">
  <div class="Page_Left">
  <c:if test="${empty requestScope.post}" var="po">
  <p class="Page_Title">没有该帖</p>
  <div class="Title_Line"></div>
    <div class="Page_Main">
    	
        <div class="Page_Main_All">
    	<div class="Tringle_P"></div>
        	<div class="Page_Main_Middle">
            　　		没有此帖子的详细内容!
            </div>
        	<div class="Page_Main_Bottom"></div>
        </div>
    </div>
  </c:if>
  <c:forEach items="${requestScope.post}" var="post">
    <p class="Page_Title">${post.ptitle}</p>
    <div class="Title_Line"></div>
    <div class="Page_Main">
    	<a href="${applicationScope.path }/Pro?uid=${post.uid}"><img src="${post.uphoto}" class="User_Pic" /></a>
        <div class="Page_Main_All">
    	<div class="Tringle_P"></div>
        	<div class="Page_Main_Middle">
        	<p class="User_Title"><a href="#">${post.uname}</a>（${post.uinfo}）</p>
            <p class="Article_Info">领域：${post.ftype}&nbsp;&nbsp;&nbsp;&nbsp;标签：${post.ptag}&nbsp;&nbsp;&nbsp;&nbsp;发布时间：${post.pdate}<span class="Hidden_Info"><span class="Warming" onclick="report(${post.pid});rep('problem');">举报</span><span class="Law">&nbsp;</span></span></p>
            　　		${post.pcontent}
            </div>
        	<div class="Page_Main_Bottom"></div>
        </div>
    </div>
    </c:forEach>
     <c:if test="${empty requestScope.answer}" var="ans">
    <div class="Page_Main">
        <div class="Reply_Main_All">
        	<div class="Reply_Main_Middle">
            　			暂无最新回复
            </div>
        	<div class="Reply_Main_Bottom"></div>
        </div>
    </div>
     </c:if>
    <c:forEach items="${requestScope.answer}" var="an">
    <div class="Page_Main">
    	<a href="${applicationScope.path }/Pro?uid=${an.wuid}"><img src="${an.uphoto}" class="User_Pic" /></a>
        <div class="Reply_Main_All">
        <div class="Digg_Reply">
       	  <p style="border-bottom:2px solid #FFF;"><img src="images/digg.jpg" align="absmiddle" onclick="ps1(${an.wid});"/><span id="ps${an.wid}">${an.wagree}</span>人支持</p>
          <p><img src="images/bury.jpg" align="absmiddle" onclick="ps2(${an.wid});"/><span id="dis${an.wid}">${an.wdisagree}</span>人反对</p>
        </div>
    	<div class="Tringle_R"></div>
        	<div class="Reply_Main_Middle">
        	<p class="User_Title"><a href="#">${an.uname}</a>（${an.uinfo}）</p>
            　			${an.wcontent} 
           	<p class="Comment_Info">发表时间：${an.wdate}<span class="Comment" onclick="spid(${an.wid});"> 追加评论</span><span class="Hidden_Info"><span class="Warming" onclick="report(${an.wid});rep('answers');">举报</span><span class="Law">&nbsp;</span></span></p>
        	</div>
        	<div class="Reply_Main_Bottom"></div>
    	</div>
    </div>
    </c:forEach>
     <div class="Pages">
        <a href="?pid=${requestScope.pid }&&page=1" class="Pages_a">首  页</a>
    	<c:choose>
        	<c:when test="${requestScope.page>1 }">
        		<a href="?pid=${requestScope.pid }&&page=${requestScope.page -1 }" class="Pages_a">上一页</a>
        	</c:when>
        	<c:otherwise>
				<a class="Pages_a">上一页</a>        	
        	</c:otherwise>
        </c:choose>
        <c:choose>
        <c:when test="${requestScope.page+1>requestScope.csize}">
        <a class="Pages_a">下一页</a>
        <a href="?pid=${requestScope.pid }&page=${requestScope.csize }" class="Pages_a">末页</a>
        </c:when>
        	<c:otherwise>
        		<a href="?pid=${requestScope.pid }&page=${requestScope.page +1 }" class="Pages_a">下一页</a>
        		<a href="?pid=${requestScope.pid }&&page=${requestScope.csize }" class="Pages_a">末页</a>
        	</c:otherwise>
        </c:choose>
    </div>
     <form style="clear:both;width:670px;" method="post" action="Post">
     	<input type="hidden" name="action" value="reply" />
     	<input type="hidden" value="${requestScope.pid}" name="pid"/>
    <textarea id="redactor_content" name="content" style="height:150px;"></textarea>
    <input type="submit" class="Blue_Button" value="提交" />
    </form>
  </div>
  <div class="Page_Right">
  	<input type="button" class="Green_Button" value="立即回复" /><br/>
     <div class="Invite_Box">
    	<p align="center">邀请他人解决问题</p>
    	<input type="text" id="Invite_Input" value="搜索人名、社团..." onfocus='if(this.value=="搜索人名、社团...")this.value="";' onblur='if(this.value=="")this.value="搜索人名、社团..."'  onchange="seek(this.value);" />
        <ul id="User_Result">
        </ul>
    </div>
    <div class="Page_Tops">
    	<div class="Page_Tops_Title">
        	<p>同领域热帖</p>
        </div>
    	<ul>
    		<c:forEach items="${requestScope.hot}" var="card" varStatus="s">
    		<c:choose>
    			<c:when test="${s.index+1<=3}">
				        <li><span class="Page_Tops_Code1">${s.index+1}</span><a href="${applicationScope.path }/QApage?pid=${card.cdid}">${card.cdtitle}</a></li>
				</c:when>
				<c:otherwise>
				        <li><span class="Page_Tops_Code2">${s.index+1}</span><a href="${applicationScope.path }/QApage?pid=${card.cdid}">${card.cdtitle}</a></li>
				</c:otherwise>
			</c:choose>
          	</c:forEach>
        </ul>
    </div>
    <div class="Page_Tops">
    	<div class="Page_Tops_Title">
        	<p>热帖总榜</p>
        </div>
    	<ul>
        	<c:forEach items="${requestScope.hot}" var="card" varStatus="s">
    		<c:choose>
    			<c:when test="${s.index+1<=3}">
				        <li><span class="Page_Tops_Code1">${s.index+1}</span><a href="${applicationScope.path }/QApage?pid=${card.cdid}">${card.cdtitle}</a></li>
				</c:when>
				<c:otherwise>
				        <li><span class="Page_Tops_Code2">${s.index+1}</span><a href="${applicationScope.path }/QApage?pid=${card.cdid}">${card.cdtitle}</a></li>
				</c:otherwise>
			</c:choose>
          	</c:forEach>
        </ul>
    </div>
  </div>
</div>
<div class="Page_Bottom"></div>
<div class="Bottom">
  <p><a href="#"><img src="images/LOGO_gray.jpg" align="left" /></a> <a href="#">奋青首页</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">社团中心</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">交流圈子</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">活动中心</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">帮助中心</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#">使用反馈</a>&nbsp;&nbsp;|&nbsp;&nbsp;联系我们：<a href="mailto:scdzwyxst@gmail.com">scdzwyxst@gmail.com</a>&nbsp;&nbsp;<br />
    CopyRight&copy;&nbsp;2012&nbsp;MayDay  All Rights Reserved</p>
</div>
</body>
</html>
